/*
 * @Description: 
 * @Date: 2020-12-11 14:00:05
 * @LastEditors: lother
 * @LastEditTime: 2020-12-15 10:08:36
 * @FilePath: \AccounOpening-WEB\src\api\openProcess\Hopen.js
 */
import request from '@/utils/request'
// 列表
export function getList(data) {
  return request({
    url: '/open/flow',
    method: 'get',
    params: data
  })
}


/**
 * @description: 修改页面状态
 * @param {*} id 
 * @return {*}
 */
export function putStatus(id) {
    return request({
      url: '/open/flow/switch/status/'+id,
      method: 'put',
      msg: true
    })
  }

/**
 * @description: 流程排序 
 * @param {*} data 字符串 (1,2,3,4,5)
 * @return {*}
 */
export function postSort(data) {
    return request({
      url: '/open/flow/page/sort',
      method: 'post',
      data,
      msg: true
    })
}

/**
 * @description: 删除
 * @param {*} id
 * @return {*}
 */
export function delFlow(id) {
    return request({
      url: '/open/flow/'+id,
      method: 'delete',
      msg: true
    })
}

/**
 * @description: 新增 页面
 * @param {*} data
 * @return {*}
 */
export function addPage(data) {
    return request({
      url: '/open/flow',
      method: 'post',
      data,
      msg: true
    })
}



/**
 * @description: 修改 页面 
 * @param {*} id 当前页面的id
 * @param {*} data       
 * @return {*}
 */
export function editPage(id,data) {
  return request({
    url: '/open/flow/'+id,
    method: 'put',
    data,
    msg: true
  })
}

/**
 * @description:  获取 页面的数据
 * @param {*} id 当前页面id
 * @return {*}
 */
export function getFlow(id) {
  return request({
    url: '/open/flow/'+id,
    method: 'get',
  })
}
